Skip to content

feat(console): the create-workspace dialog shows the unpaid-organization limit refusal and its next step - #38047

Merged
objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/issue-34221-unpaid-org-limit
Nov 27, 2026
Merged

objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/issue-34221-unpaid-org-limit

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #34221

Clause-②: yes (widening) — @object-ui/i18n gains organization.errors.unpaidOrganizationLimitReached and organization.viewPlans in every locale
Metadata-protocol: none

维护者速读

  • 用户能看到什么变化:在云端控制台建第三个免费组织被拒时,「新建组织」对话框显示云端给的本地化说明(含下一步),云端若提供升级入口还会多一个「查看套餐并升级」链接。
  • 为什么做:云端已对每个账号限 2 个免费组织并返回新的拒绝码,控制台原来不认识它(来自云端免费组织上限那张卡的控制台一半)。
  • 出错会怎样:最坏是仍显示云端原句或控制台的通用兜底句,不会建出组织,也不影响其他拒绝;直接撤回本 PR 即可。
  • 要你做的:无。

What changes

  • orgErrorMessage.ts maps UNPAID_ORGANIZATION_LIMIT_REACHED. The row is marked preferUserMessage, so the control plane's own userMessage is shown as sent: it is written in the request's language and names the next step (ruling C on Studio: an unconfigured nav item vanishes from the navigation editor after reload while still counted as a pending draft; publish dialog shows raw type names in zh #32440, the same rule SettingsPage applies to the delete refusal). A refusal without a userMessage shows the new console key organization.errors.unpaidOrganizationLimitReached, in all eleven locales. That sentence names no number and no plan. Every other row ignores userMessage exactly as before.
  • New readOrgCreateNextStep(err) reads details.next_step (upgrade_to_team | contact_support), for this code only. Values this console does not know read as no step.
  • CreateWorkspaceDialog draws a link under the error when the step is upgrade_to_team AND the host serves getUpgradeUrl() (new key organization.viewPlans). The console never builds the address (ADR-0060; the runtime-config contract). contact_support draws no link: the sentence already names the contact address.
  • Producer read on cloud origin/main (packages/service-cloud/src/unpaid-organization-cap.ts): 403, flat { code, message, userMessage, details: { unpaid_organization_limit, unpaid_organizations, next_step } }. createOrganization throws through toAuthError, which carries code, userMessage and details from the flat body, or from the ADR-0112 envelope's error when the flat body has none. createWithGeneratedSlug rethrows any refusal that is not a slug collision unchanged, so the code reaches the dialog.

Tests

  • orgErrorMessage-4474.test.ts, new describe: producer userMessage preferred; pack fallback when it is absent or blank; every pack defines the key, no digits, not the English; readOrgCreateNextStep for both steps, an unknown step, no details, another code, and a bare Error; CONTROL: YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_ORGANIZATIONS still maps to its pack sentence and ignores a userMessage. The mapping-table code list gains the new code.
  • CreateWorkspaceDialog.test.tsx, new top-level describe: upgrade_to_team with a served entry shows the sentence and a link to it, with no retry and no provision; with no served entry there is no link; contact_support shows no link; a refusal without userMessage shows the zh pack sentence; CONTROL: better-auth's limit refusal shows no link.

Acceptance notes

  • Item 2 of the card (warn before the click) is not done: neither /auth/config nor discovery states the unpaid limit. The only source is the refusal itself.
  • The control plane's own runtime config (cloud createStudioRuntimeConfigPlugin) serves no upgradeUrl today. Tenant runtimes get one from cloud-runtime-config-plugin. So on the control plane console, where this cap fires, the link stays hidden until cloud serves the key there. The sentence still gives the step. Carrier: cloud.
  • The fallback sentence is generic about the step ("upgrade one of them to a paid plan or contact support"). It shows only when the producer sent no sentence, which the current cloud producer never does.

Verification

Read first, by risk:

  1. ui/packages/app-shell/src/console/organizations/orgErrorMessage.ts: the preferUserMessage branch in resolveOrgErrorMessage, and readOrgCreateNextStep.
  2. ui/packages/app-shell/src/console/organizations/CreateWorkspaceDialog.tsx: the setUpgradeUrl line in the catch, and the link.
  3. ui/packages/i18n/src/locales/*.ts: the two new keys.

Two-minute check: cd ui && pnpm exec vitest run packages/app-shell/src/console/organizations/__tests__/orgErrorMessage-4474.test.ts. Expected: every test passes, including the six in the UNPAID_ORGANIZATION_LIMIT_REACHED describe.

Commit 4dd68691 (all local readings below were taken on this head):

Targeted tests (vitest, from ui/)

CreateWorkspaceDialog.test.tsx, orgErrorMessage-4474.test.ts, all-locales-key-parity.test.ts, en-zh-key-parity.test.ts: Test Files 4 passed (4), Tests 113 passed (113), lock VERDICT command-exit 0.

Ablation: with the preferUserMessage branch disabled and the setUpgradeUrl read stubbed out on disk, 3 tests went red (the userMessage pin, plus the two dialog upgrade cases). Restored from HEAD, and the tree was clean afterwards.

Typecheck and lint

pnpm --filter @object-ui/i18n type-check && pnpm --filter @object-ui/app-shell type-check (both include tsconfig.test.json): exit 0. eslint on the four touched app-shell files: 0 errors, 1 pre-existing warning (react-hooks/refs on defaultNameRef, untouched).

Derived gate families

node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack: 42 local commands derived from the diff vs merge base c151c4993, all exit 0 (each captured before any pipe); --ran reconciliation exit 0. The repo-wide lint and the full farm are left to CI.


Generated by Claude Code

…ion limit refusal and its next step

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q4EjjQkY5yXZrN9BEA3rEK
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 27, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#6 · hotlong · session_01Q4EjjQkY5yXZrN9BEA3rEK

Contract review

Served-tier: TIER_DEFAULT
Head-sha: 4dd686917443aaea5753b9fb858f44910b279fff
Local-runs: none
Scope: ui/packages/i18n/src/locales/ar.ts, ui/packages/i18n/src/locales/de.ts, ui/packages/i18n/src/locales/en.ts, ui/packages/i18n/src/locales/es.ts, ui/packages/i18n/src/locales/fr.ts, ui/packages/i18n/src/locales/ja.ts, ui/packages/i18n/src/locales/ko.ts, ui/packages/i18n/src/locales/pt-BR.ts, ui/packages/i18n/src/locales/ru.ts, ui/packages/i18n/src/locales/zh-Hans.ts, ui/packages/i18n/src/locales/zh-Hant.ts + ui/packages/app-shell/src/console/organizations/orgErrorMessage.ts, ui/packages/app-shell/src/console/organizations/CreateWorkspaceDialog.tsx, ui/packages/app-shell/src/console/organizations/tests/orgErrorMessage-4474.test.ts, ui/packages/app-shell/src/console/organizations/tests/CreateWorkspaceDialog.test.tsx + read, not reviewed: .changeset/34221-unpaid-org-limit-refusal.md
Security-touching: no
Rule-change-verified: none

First record on this PR. The face is the declaration alone: record-recognisers.mjs --paths on the 16 changed paths decides no schema and no governed path, and the changeset line carries the (widening) arm, so the face is declaration and the tier is TIER_DEFAULT. Inputs: card #34221, triage 7213420175, claim 7227246396, dev report 7227947197, the PR body, git diff c151c499 4dd68691, the cited code at the head, cloud main packages/service-cloud/src/unpaid-organization-cap.ts, and the check-runs on this head. Nothing was built or run.

① Derived judgments

  • Clause-②: yes (widening): RIGHT.
    • @object-ui/i18n publishes the packs on ./locales and ./locales/*, and TranslationKeys is derived from en. Two new keys in every pack enlarge that surface and remove nothing.
    • The new app-shell symbols (UNPAID_ORGANIZATION_LIMIT_REACHED, readOrgCreateNextStep, OrgCreateNextStep, OrgErrorEntry.preferUserMessage) are not published. orgErrorMessage.ts is not re-exported from src/index.ts, and the package's exports map has . and ./styles.css only. The declaration is right to name i18n alone.
    • Same spelling as the precedent on main, .changeset/34171-managed-password-refusal-copy.md (fix(auth): a cloud-managed runtime's password refusal is shown in the session's language #37965).
  • Metadata-protocol: none: RIGHT. Nothing a metadata author writes changes. No Skills-docs: line is owed.
  • The claim said Clause-②: no. The diff decides, and the diff adds keys to a published package. The claim was wrong, the PR is right.
  • Locale parity: 11 packs (ar, de, en, es, fr, ja, ko, pt-BR, ru, zh-Hans, zh-Hant). Each gains exactly one workspace.viewPlans and one organization.errors.unpaidOrganizationLimitReached, at the same nesting, next to multiOrgDisabled and organizationLimitReached. No key removed or renamed.
  • Producer shape, read on cloud main: 403, flat { code, message, userMessage, details: { unpaid_organization_limit, unpaid_organizations, next_step } }, userMessage === message, next_step is upgrade_to_team | contact_support. The console's two-value set matches the producer's type.
  • The path to the dialog holds: createOrganization throws through toAuthError, which carries code, a non-blank userMessage and a plain-object details. createWithGeneratedSlug rethrows anything that is not a slug collision.

② Semver level

  • @object-ui/i18n patch, @object-ui/app-shell patch, @object-ui/console patch: right. AGENTS.md Post-Task step 3: kind none takes patch, and a non-protocol widening ships patch.
  • Not BREAKING: no banner, no migration and no ADR-0087 marker are owed.
  • The changeset and the PR body carry the same two declaration lines. Check Changeset is success on this head.

③ Boundary flags

  • preferUserMessage is safe.
    • The sentence is rendered as a React text child of <p data-testid="workspace-create-error">. No dangerouslySetInnerHTML, no markdown, no interpolation into an attribute. Markup in a userMessage from any producer shows as text.
    • It adds no trust. For an unmapped code the dialog already shows err.message verbatim from the same server. Before this diff, this very refusal showed the same producer sentence by that route.
    • The flag is set on one row. producerUserMessage requires a non-blank string, else the pack key.
  • next_step is read for this code only. readOrgCreateNextStep returns undefined unless errorCode(err) is UNPAID_ORGANIZATION_LIMIT_REACHED, and accepts only the two known strings. The sentence is never parsed. A test pins details.next_step: 'upgrade_to_team' on the better-auth code as no step.
  • The link is hidden when no upgrade URL is served. The catch sets upgradeUrl to getUpgradeUrl() only for upgrade_to_team, and the render is error && upgradeUrl. The state is cleared on open and on each submit. Unlike the four other consumers, there is no cloudConsoleUrl() fallback, so the console composes no address.
  • The link target is the runtime config's upgradeUrl, taken verbatim by the console. http: / https: is enforced at the producer (isAbsoluteHttpUrl in packages/cloud-connection/src/runtime-config-plugin.ts). This is the existing contract of the key and this diff does not change it. rel="noopener noreferrer" is set.
  • CONTROL: the YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_ORGANIZATIONS row is byte-identical. Two tests pin it: it maps to organization.errors.organizationLimitReached, ignores a userMessage, and draws no link.
  • The claim's file surface covers the diff: orgErrorMessage.ts, the dialog, their tests, the i18n packs, one changeset.
  • Security-touching: no: no hunk teaches permission, credential or authentication behaviour. The diff shows a refusal the server already made.
  • SQL push-down: no data access in the diff. Nothing to report.
  • Author: objectstack-fleet[bot].
  • Main: the head merges without conflict (merge-tree, no checkout).
  • Check-runs on this head, read at 2026-11-27T20:57:04Z: 55 runs, 13 success, 13 skipped, 29 in progress, none failed.
    • Success: Check Changeset, PR-body guards, Governed Surface Queue Guard, Dogfood Regression Gate, Test Core, Type Check · workspace, Type Check · debt ledger, Build UI Deps, Plan Test UI shards, Live E2E UI, Check PR Size, Auto Label, filter.
    • Not yet answered: Type Check UI, Lint UI, Build & E2E UI, Test UI 1/16 to 16/16, the Lint families, Type Check · source gates and consumer gates.
    • "All green" is not established on this head. It is the seat's to read before the PR is queued.

Findings. None is must-fix or should-fix.

  • N1 (nit, a card). The producer writes four locales (en, zh-CN, ja-JP, es-ES) and English otherwise. It picks by ?locale=, else Accept-Language; the auth client sends neither from the console's language.
    • So a console session in de, fr, ko, ru, ar, pt-BR or zh-Hant shows the English producer sentence, and its translated pack sentence is not reached against the current producer. A session whose console language differs from the browser's can get the browser's.
    • This is what the card asks (prefer the producer's sentence, ruling C on Studio: an unconfigured nav item vanishes from the navigation editor after reload while still counted as a pending draft; publish dialog shows raw type names in zh #32440) and it is not a regression: before the diff the same sentence was shown. The producer sentence also carries the numbers and the exact step, which the pack cannot.
    • The changeset and PR body say "in the request's language", which holds for four locales. Prose face, not blocking. Carrier: cloud (more locales), or the console sending its language on the create.
  • N2 (nit, a card). On the control plane's own console, where this cap fires, no upgradeUrl is served today, so the link stays hidden. The PR body states it and names the carrier (cloud), but the dev report says it was not filed. The seat files it through filing-gate.md.
  • N3 (nit, accepted). Card item 2 (warn before the click) is not done. The card makes it conditional on the host stating the limit, and neither /auth/config nor discovery does. Fixes #34221 is right.
  • N4 (nit, bookkeeping). The seat's note of the declaration change against claim 7227246396 is owed in its L1 record. The dev report already names the deviation.

Implemented-by: claude/issue-34221-unpaid-org-limit
Reviewed-by: session_01Q4EjjQkY5yXZrN9BEA3rEK

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#6 · hotlong · session_01Q4EjjQkY5yXZrN9BEA3rEK

Contract review

Served-tier: TIER_DEFAULT
Head-sha: df235f646feb5fe1568c1bd8ccf72ff03cb69d36
Local-runs: none
Scope: ui/packages/i18n/src/locales/ar.ts, ui/packages/i18n/src/locales/de.ts, ui/packages/i18n/src/locales/en.ts, ui/packages/i18n/src/locales/es.ts, ui/packages/i18n/src/locales/fr.ts, ui/packages/i18n/src/locales/ja.ts, ui/packages/i18n/src/locales/ko.ts, ui/packages/i18n/src/locales/pt-BR.ts, ui/packages/i18n/src/locales/ru.ts, ui/packages/i18n/src/locales/zh-Hans.ts, ui/packages/i18n/src/locales/zh-Hant.ts + ui/packages/app-shell/src/console/organizations/orgErrorMessage.ts, ui/packages/app-shell/src/console/organizations/CreateWorkspaceDialog.tsx, ui/packages/app-shell/src/console/organizations/tests/orgErrorMessage-4474.test.ts, ui/packages/app-shell/src/console/organizations/tests/CreateWorkspaceDialog.test.tsx + read, not reviewed: .changeset/34221-unpaid-org-limit-refusal.md, ui/docs/adr/0060-product-neutral-renderer.md, ui/packages/app-shell/src/tests/product-neutral-renderer.ratchet.test.ts
Security-touching: no
Rule-change-verified: none

Delta round by the reviewer of record 7228012752 (PASS at 4dd68691). That head went red in CI on two tests the record did not foresee: zh-hant-generated (Test UI 8/16 or 10/16) and the ADR-0060 ratchet. The record read the 11-pack parity and missed both that zh-Hant is generated and that workspace is a frozen namespace. Inputs here: git diff 4dd68691 df235f64 (two commits, 14 files, 16 lines each way), dev report 7228358190, the PR body, ADR-0060 and its ratchet test at the head, and the check-runs on this head. Nothing was built or run.

① Derived judgments

  • The delta is three things and no more:
    • the link key moved from workspace.viewPlans to organization.viewPlans in all 11 packs, in the dialog's one t() call and in the changeset's two mentions. The values are byte-identical in the 10 packs other than zh-Hant;
    • zh-Hant's two new values are now the generator's: 帳號 became 賬號, 方案 became 套餐, 查看 became 檢視;
    • one test line reads the zh-Hans pack as { organization: { viewPlans: string } }.
  • orgErrorMessage.ts, its test, the dialog's state and render logic, and the unpaidOrganizationLimitReached key are untouched. The judgments of 7228012752 on preferUserMessage, next_step, the hidden link and the CONTROL row stand as written there.
  • Clause-②: yes (widening): still RIGHT. The key was never released under workspace, so the move removes nothing published. Metadata-protocol: none: unchanged.
  • Parity at this head: each of the 11 packs has exactly one viewPlans, under top-level organization, and exactly one unpaidOrganizationLimitReached, under organization.errors. No workspace.viewPlans is left in ui/packages or the changeset.
  • organization is not frozen, and the move is the remedy ADR-0060 names.
    • The ADR's frozen set lists organizations (plural), workspace and environment. It names organization (singular) under "Considered and not frozen", because the layout's indicator and switcher and @object-ui/auth read it too.
    • The ratchet's two locale rules both pass on the new key: it sits under no frozen namespace, and viewPlans does not lead with a product word (cloud, hotcrm).
    • The allowlist, the ADR and the ratchet test are not in the diff.
    • The copy is neutral: "View plans and upgrade" names no product, plan or number, and the link is drawn for any host that serves upgradeUrl.
    • The home fits. The frozen console/organizations/** pages already read organization.settings, .accept, .invitations, .members and .errors.

② Semver level

  • Unchanged: @object-ui/i18n, @object-ui/app-shell and @object-ui/console at patch. Right for a non-protocol widening.
  • The changeset and the PR body carry the same two declaration lines, and both now name organization.viewPlans. Check Changeset is success on this head.

③ Boundary flags

  • The ratchet states what it cannot see: growth inside an existing file under a frozen directory, and copy under a neutral name. Both describe this diff, so this is the review's call. It is accepted: card Console: the create-workspace dialog shows the unpaid-organization limit refusal (UNPAID_ORGANIZATION_LIMIT_REACHED) with its next step #34221 directs the change in these two files, and the copy is neutral as read in ①. No ADR amendment is owed.
  • zh-Hant was not regenerated here (Local-runs: none). The proof is CI: Test UI 8/16 and 10/16, the two shards red at 4dd68691, are both success on this head.
  • The dev report says 48298e0e was pushed with the app-shell type-check failing (TS2352 on the test cast). df235f64 fixes it, and Type Check UI is success on this head. No intermediate head was queued.
  • Security-touching: no, as before. SQL push-down: nothing in the delta.
  • Main: the head merges without conflict (merge-tree, no checkout). Auto-merge is not armed.
  • Check-runs on this head, read at 2026-11-27T21:37:13Z: 61 runs, 41 success, 15 skipped, 5 in progress, none failed.
    • Success includes Type Check UI, Lint UI, Build & E2E UI, Live E2E UI, Test Core, every Lint and Type Check family, Check Changeset, PR-body guards, Governed Surface Queue Guard, and Test UI 3, 4, 7 to 15 of 16.
    • Not yet answered: Test UI 1/16, 2/16, 5/16, 6/16 and 16/16. At 4dd68691 the failed shards were 8/16 and 10/16 only.
    • "All green" is not yet established on this head. It is the seat's to read before the PR is queued.

Findings of record 7228012752, at this head. No must-fix, no should-fix.

  • N1 (open, a card). The producer writes four locales and picks by the browser's language. Unchanged.
  • N2 (open, a card). The control plane serves no upgradeUrl today, so the link stays hidden where this cap fires. Unchanged; the dev report again names it as not filed.
  • N3 (accepted). Card item 2 not done. Unchanged.
  • N4 (open, bookkeeping). The seat's note of the declaration change against claim 7227246396.
  • N5 (new, nit, prose). The PR body's Verification section still reads "Commit 4dd68691 (all local readings below were taken on this head)". The readings for this head are in dev report 7228358190. The seat corrects the line or points at that report.

Implemented-by: claude/issue-34221-unpaid-org-limit
Reviewed-by: session_01Q4EjjQkY5yXZrN9BEA3rEK

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#6 · hotlong · session_01Q4EjjQkY5yXZrN9BEA3rEK

维护者速读

席位核对 — ACCEPT · repo:objectstack#6 · head df235f646feb5fe1568c1bd8ccf72ff03cb69d36

  • Shape: draft → main, Fixes #34221 (card item 2 not done: the host does not state the limit).
  • Premise measured on main (dev report 7227947197): the code was unmapped, err.message shown verbatim, no next step. Producer shape confirmed on cloud main (flat 403, userMessage, details.next_step).
  • Declaration change against claim 7227246396: the claim said Clause-②: no; the PR declares Clause-②: yes (widening) (two keys in published @object-ui/i18n), Metadata-protocol: none, patch.
  • CI rework at 4dd68691: zh-Hant regenerated by the generator; link key moved to organization.viewPlans (ADR-0060: workspace is frozen, organization is not). Dev report 7228358190. PR body corrected by the seat.
  • Review history: contract review PASS 7228012752 (TIER_DEFAULT) → delta PASS 7228629756, no must-fix or should-fix open.
  • Gates: check-runs at head 47 success, 15 skipped, 0 failed (the two shards red at 4dd68691 are green).
  • Follow-ups filed: cloud#5173 (control plane serves no upgradeUrl), cloud#5174 (producer sentence in four locales only).
  • Landing: --land.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#6 · hotlong · session_01Q4EjjQkY5yXZrN9BEA3rEK

Landing: seat ACCEPT and contract review PASS 7228629756 at head df235f646feb5fe1568c1bd8ccf72ff03cb69d36; check-runs 47 success, 15 skipped, 0 failed. Marking ready and arming auto-merge.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 27, 2026 21:41
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 27, 2026
Merged via the queue into main with commit 5f48cb0 Nov 27, 2026
63 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-34221-unpaid-org-limit branch November 27, 2026 22:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Console: the create-workspace dialog shows the unpaid-organization limit refusal (UNPAID_ORGANIZATION_LIMIT_REACHED) with its next step

2 participants